import java.net.URI

import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}

object HDFSApp {

  System.setProperty("hadoop.home.dir", "C:\\hadoop")

  def main(args: Array[String]) {
    val configuration = new Configuration
    val uri = new URI("hdfs://bdptest1:8020")
    val fileSystem = FileSystem.get(uri, configuration, "hadoop")

    //    val in: FSDataInputStream = fileSystem.open(new Path("/g5/test/ruozedata-hadoop.txt-bak"))
    //    IOUtils.copyBytes(in, System.out, 1024)

    val flag = fileSystem.append(new Path("/root/test2"))
    println(flag)
  }


}
